package pl.krgr.vm2.ui.actions;

import org.springframework.beans.factory.annotation.Autowired;

import pl.vm.model.OfficialTeam;
import pl.vm.service.SeazonService;

import com.opensymphony.xwork2.ActionSupport;

public class AddTeamAction extends ActionSupport {

	private static final long serialVersionUID = 1L;
	@Autowired
	private SeazonService seazonService;
	
	private String teamName;
	private long seazonId;
	
	public String execute() throws Exception {
		seazonService.addOfficialTeam(new OfficialTeam(teamName), seazonId);
		return SUCCESS;
	}

	public String getTeamName() {
		return teamName;
	}

	public void setTeamName(String teamName) {
		this.teamName = teamName;
	}

	public long getSeazonId() {
		return seazonId;
	}

	public void setSeazonId(long seazonId) {
		this.seazonId = seazonId;
	}

}
